<%@page import="POJO.KhachHang"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
	<%@page import="POJO.NguoiDung"%>
	<%
	    String name = "suaKhachHang";
	    String err = (String) session.getAttribute("id");

	    if (err == "1")
	    {
	        // da dang nhap
	        // Lấy loại người dùng
	        NguoiDung nguoiDung = (NguoiDung) session
	                .getAttribute("nguoiDung");
	        if (!(nguoiDung.getLoai() == 1 || nguoiDung.getLoai() == 4))
	        {
	            RequestDispatcher dispatcher = request
	                    .getRequestDispatcher("/view/Permission.jsp");
	            dispatcher.forward(request, response);
	        }
	    }
	    else
	    {
	        response.sendRedirect("login");
	    }
	    
	    KhachHang kh = (KhachHang) request.getAttribute("khachHang");
	    
	%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
	<title>Thêm sản phẩm</title>
	<link rel="stylesheet" href="http://localhost:8080/OnlineShop/css/style.css" type="text/css" media="all" />
</head>
<body>
<!-- Header -->
<div id="header"></div>
<!-- End Header -->

<!-- Container -->
<div id="container">
	<div class="shell">
		
	  <div id="main"><!-- Content -->
			<div id="content">
				
				<!-- Box --><!-- End Box -->
				
				<!-- Box -->
				<div class="box">
					<!-- Box Head -->
					<div class="box-head">
						<h2>Thay đổi thông tin khách hàng</h2>
					</div>
					<!-- End Box Head -->
					
					<form action="" method="post">
						
						<!-- Form -->
							<form method="post" action="<% out.print(name); %>" >
								<div class="form">
									<p>
										<span class="req">max 100 symbols</span> <label>Tên khách hàng<span>(bắt buộc)</span>
										</label> 
										<input type="text" class="field size1" name="<% out.print(name); %>" value="<%=kh.getHoTen() %>"/>
									</p>									
								  <p>
										<span class="req">max 100 symbols</span> <label>Địa chỉ<span>(bắt buộc)</span></label>
                                      <input name="<% out.print(name); %>" type="text" class="field size1" value="<%=kh.getDiaChi() %>" size="30" />
									</p>
								  <p>
										<label>Email<span>(bắt buộc)</span></label> 
										<input type="text" class="field size1" name="<% out.print(name); %>" value="<%=kh.getEmail() %>"/>
									</p>
									<p>
										<label>Điện thoại<span>(bắt buộc)</span></label> 
										<input
											type="text" class="field size1" name="<% out.print(name); %>" value="<%=kh.getDienThoai() %>"/>
									</p>
									<p>
									  <label>Tình trạng<span>(bắt buộc)</span></label> <input
											type="text" class="field size1" name="<% out.print(name); %>" value="<%=kh.getTinhTrang() %>"/>
								  </p>
									<p>
										<label>Điểm tích lũy<span>(bắt buộc)</span></label> 
										<input type="text" class="field size1" name="<% out.print(name); %>" value="<%=kh.getDiemTichLuy() %>"/>
										<input type="hidden" name="<% out.print(name); %>" value="<%=kh.getMaKhachHang() %>"/>
									</p>
									<p>
										<input type="submit" class="button" value="Submit" />
									</p>
								</div>
							</form>
					</form>
			  </div>
				<!-- End Box -->

		  </div>
			<!-- End Content -->
			
			<!-- Sidebar --><!-- End Sidebar -->
			
		  <div class="cl">&nbsp;</div>			
	  </div>
		<!-- Main -->
  </div>
</div>
<!-- End Container -->

<!-- Footer -->
<div id="footer">
	<div class="shell">
		<span class="left">&copy; 2010 - CompanyName</span>
		<span class="right">
			Design by <a href="http://chocotemplates.com" target="_blank" title="The Sweetest CSS Templates WorldWide">Chocotemplates.com</a>
		</span>
	</div>
</div>
<!-- End Footer -->
	
</body>
</html>